/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eu.easyedu.dictionary.explorer;

import eu.easyedu.dictionary.api.resources.Bundle;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import org.openide.util.ImageUtilities;
import org.openide.windows.TopComponent;

/**
 * Action which shows DictionaryExplorer component.
 */
public class DictionaryExplorerAction extends AbstractAction {

    private static final long serialVersionUID = 1L;
    static final String ICON_PATH = Bundle.getResourcesPath() + "/dictionaries16x16.png";
    
    public DictionaryExplorerAction() {
        super(Bundle.getMessage("CTL_DictionaryExplorerAction"));
        putValue(SMALL_ICON, new ImageIcon(ImageUtilities.loadImage(ICON_PATH, true)));
    }

    public void actionPerformed(ActionEvent evt) {
        TopComponent win = DictionaryExplorerTopComponent.findInstance();
        win.open();
        win.requestActive();
    }
}
